const KEYBOARD = [{
    "keyboard_id": 1,
    "name": "United States Standard",
    "type": "qwerty",
    "structure": [[{
        "shifted": {"key": "~", "code": "126"},
        "main": {"key": "`", "code": "96"},
        "finger": "1"
    }, {
        "shifted": {"key": "!", "code": "33"},
        "main": {"key": "1", "code": "49"},
        "finger": "1"
    }, {
        "shifted": {"key": "@", "code": "64"},
        "main": {"key": "2", "code": "50"},
        "finger": "2"
    }, {
        "shifted": {"key": "#", "code": "35"},
        "main": {"key": "3", "code": "51"},
        "finger": "3"
    }, {
        "shifted": {"key": "$", "code": "36"},
        "main": {"key": "4", "code": "52"},
        "finger": "4"
    }, {
        "shifted": {"key": "%", "code": "37"},
        "main": {"key": "5", "code": "53"},
        "finger": "4"
    }, {
        "shifted": {"key": "^", "code": "94"},
        "main": {"key": "6", "code": "54"},
        "finger": "7"
    }, {
        "shifted": {"key": "&", "code": "38"},
        "main": {"key": "7", "code": "55"},
        "finger": "7"
    }, {
        "shifted": {"key": "*", "code": "42"},
        "main": {"key": "8", "code": "56"},
        "finger": "8"
    }, {
        "shifted": {"key": "(", "code": "40"},
        "main": {"key": "9", "code": "57"},
        "finger": "9"
    }, {"shifted": {"key": ")", "code": "41"}, "main": {"key": "0", "code": "48"}}, {
        "shifted": {
            "key": "_",
            "code": "95"
        }, "main": {"key": "-", "code": "45"}, "finger": "10"
    }, {
        "shifted": {"key": "+", "code": "43"},
        "main": {"key": "=", "code": "61"},
        "finger": "10"
    }, {
        "main": {"key": "Back <-", "code": "8"},
        "width": "74",
        "right": 1,
        "finger": "10",
        "other": 1
    }], [{
        "main": {"key": "Tab \u21b9", "code": "9"},
        "left": 1,
        "width": "68",
        "finger": "1",
        "other": 1
    }, {"main": {"key": "q", "code": "113"}, "finger": "1"}, {
        "main": {"key": "w", "code": "119"},
        "finger": "2",
        "toupper": 1
    }, {"main": {"key": "e", "code": "101"}, "finger": "3", "toupper": 1}, {
        "main": {"key": "r", "code": "114"},
        "finger": "4",
        "toupper": 1
    }, {"main": {"key": "t", "code": "116"}, "finger": "4", "toupper": 1}, {
        "main": {"key": "y", "code": "121"},
        "finger": "7",
        "toupper": 1
    }, {"main": {"key": "u", "code": "117"}, "finger": "7", "toupper": 1}, {
        "main": {"key": "i", "code": "105"},
        "finger": "8",
        "toupper": 1
    }, {"main": {"key": "o", "code": "111"}, "finger": "9", "toupper": 1}, {
        "main": {"key": "p", "code": "112"},
        "finger": "10",
        "toupper": 1
    }, {
        "shifted": {"key": "{", "code": "123"},
        "main": {"key": "[", "code": "91"},
        "finger": "10"
    }, {
        "shifted": {"key": "}", "code": "125"},
        "main": {"key": "]", "code": "93"},
        "finger": "10"
    }, {
        "shifted": {"key": "|", "code": "124"},
        "main": {"key": "\\", "code": "92"},
        "width": "48",
        "finger": "10"
    }], [{
        "main": {"key": "Caps 🔒", "code": "0"},
        "left": 1,
        "width": "83",
        "finger": "1",
        "other": 1
    }, {"main": {"key": "a", "code": "97"}, "finger": "1", "toupper": 1}, {
        "main": {"key": "s", "code": "115"},
        "finger": "2",
        "toupper": 1
    }, {"main": {"key": "d", "code": "100"}, "finger": "3", "toupper": 1}, {
        "main": {"key": "f", "code": "102"},
        "finger": "4",
        "toupper": 1
    }, {"main": {"key": "g", "code": "103"}, "finger": "4", "toupper": 1}, {
        "main": {"key": "h", "code": "104"},
        "finger": "7",
        "toupper": 1
    }, {"main": {"key": "j", "code": "106"}, "finger": "7", "toupper": 1}, {
        "main": {"key": "k", "code": "107"},
        "finger": "8",
        "toupper": 1
    }, {"main": {"key": "l", "code": "108"}, "finger": "9", "toupper": 1}, {
        "shifted": {"key": ":", "code": "58"},
        "main": {"key": ";", "code": "59"},
        "finger": "10"
    }, {
        "shifted": {"key": "\"", "code": "34"},
        "main": {"key": "'", "code": "39"},
        "finger": "10"
    }, {
        "main": {"key": "Enter \u23ce", "code": "13"},
        "width": "83",
        "finger": "10",
        "right": 1,
        "other": 1
    }], [{
        "main": {"key": "Shift \u21e7", "code": "16"},
        "left": 1,
        "width": "108",
        "finger": "1",
        "other": 1
    }, {"main": {"key": "z", "code": "122"}, "finger": "1", "toupper": 1}, {
        "main": {"key": "x", "code": "120"},
        "finger": "2",
        "toupper": 1
    }, {"main": {"key": "c", "code": "99"}, "finger": "3", "toupper": 1}, {
        "main": {"key": "v", "code": "118"},
        "finger": "4",
        "toupper": 1
    }, {"main": {"key": "b", "code": "98"}, "finger": "4", "toupper": 1}, {
        "main": {"key": "n", "code": "110"},
        "finger": "7",
        "toupper": 1
    }, {"main": {"key": "m", "code": "109"}, "finger": "7", "toupper": 1}, {
        "shifted": {"key": "<", "code": "60"},
        "main": {"key": ",", "code": "44"},
        "finger": "8"
    }, {
        "shifted": {"key": ">", "code": "62"},
        "main": {"key": ".", "code": "46"},
        "finger": "9"
    }, {
        "shifted": {"key": "?", "code": "63"},
        "main": {"key": "/", "code": "47"},
        "finger": "10"
    }, {
        "main": {"key": "\u21e7 Shift", "code": "16"},
        "width": "108",
        "right": 1,
        "finger": "10",
        "other": 1
    }], [{"main": {"key": "Ctrl", "code": "17"}, "left": 1, "width": "50", "other": 1}, {
        "main": {
            "key": "Alt",
            "code": "18"
        }, "left": 1, "width": "50", "other": 1
    }, {"main": {"key": "Cmd", "code": "157"}, "left": 1, "width": "70", "other": 1}, {
        "main": {
            "key": "",
            "code": "32"
        }, "left": 1, "width": "336", "finger": "6", "other": 1
    }, {"main": {"key": "Cmd", "code": "157"}, "width": "70", "right": 1, "other": 1}, {
        "main": {
            "key": "Alt",
            "code": "18"
        }, "width": "50", "right": 1, "other": 1
    }, {"main": {"key": "Ctrl", "code": "17"}, "width": "50", "right": 1, "other": 1}]],
    "diffs": [],
    "sort_order": 1
}];


export const qwerty = KEYBOARD[0];
const aToZ = Array.from({length: 26}, (_, k) => (k + 97)).reduce((acc, cur) => ({
    ...acc,
    [String.fromCharCode(cur)]: cur
}), {});
export const KeyCodes = {
    space: 32,
    backspace: 8,
    ...aToZ,
};
